Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: More Macintosh Toolbox

Previous | Chapter Top | Chapter Contents | Next |

Targeting a Component Instance

Your component can target a component instance without capturing the component or your component can first capture the component and then target a specific instance of the component. For information on capturing components, see "Capturing Components," . To target a component instance, use the ComponentSetTarget function.

ComponentSetTarget

You can use the ComponentSetTarget function to call a component's target request routine (that is, the routine that handles the kComponentTargetSelect request code). The target request informs a component that it has been targeted by another component.

You should not target a component instance if the component does not support the target request. Before calling this function, you should issue a can do request to the component instance you want to target to verify that the component supports the target request. If the component supports it, use the ComponentSetTarget function to send a target request to the component instance you wish to target. After receiving a target request, the targeted component instance should call the component instance that targeted it whenever the targeted component instance would normally call one of its defined functions.

FUNCTION ComponentSetTarget (ci: ComponentInstance;
                                          target: ComponentInstance): LongInt;
ci
The component instance to which to send a target request (the component that has been targeted).
target
The component instance of the component issuing the target request.

DESCRIPTION

The ComponentSetTarget function returns a function result of badComponentSelector if the targeted component does not support the target request. Otherwise, the ComponentSetTarget function returns as its function result the value that the targeted component instance returned in response to the target request.

SEE ALSO

For details on how to handle the target request, see "Responding to the Target Request" .


© 1999 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next